home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1995 May / cd Ware (Juegos) Epimundo.iso / DOS / TOOLS / NJSTACK.ZIP / NJSTACK.DOC < prev    next >
Encoding:
Text File  |  1989-03-18  |  3.8 KB  |  120 lines

  1.  
  2. Nifty James' Stack Checker
  3. For Microsoft C
  4.  
  5. Version 1.00 of 31 March, 1989
  6.  
  7. (C)  Copyright 1989 by Mike Blaszczak, All Rights Reserved.
  8.  
  9.  
  10. Description
  11. -----------
  12.  
  13. The NJSTACK Package contains a set of .OBJ files that may be linked
  14. with existing programs or programs that are under development.  These
  15. .OBJ files contain a redefined version of Microsoft's _chkstk
  16. routine.
  17.  
  18. _chkstk is used to set up space for local variables and to ascertain
  19. the amount of space left on the stack.  It is called before the
  20. beginning of each C function, when stack-checking is not turned off
  21. with the /Gs compiler option.  If there is not enough stack space,
  22. the routine terminates the program with the error message
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29. Function
  30. --------
  31.  
  32. While developing software, especially very large programs, it is
  33. often necessary to make sure that there will be enough stack space
  34. for all conditions.  NJSTACK's modified _chkstk routine maintains a
  35. globally available variable called highmark.  This variable, of type
  36. size_t, marks the highest point that the stack has reached since the
  37. program began executing.
  38.  
  39. This information can be printed out after the program finishes to see
  40. if the stack selected is big enough for the program.  It may also be
  41. displayed, stored, or used to cause the program to take corrective
  42. measures or to bail out cleanly before any serious trouble is caused.
  43.  
  44.  
  45.  
  46. Use
  47. ---
  48.  
  49. You may use LINK to insert NJSTACK into any of your programs.  First,
  50. compile all of your sourcecode and produce all of the object modules
  51. necessary.  Then, specify the appropriate version of NJSTACK on the
  52. command line for LINK.  For example, one might rebuild the STAKDEMO
  53. program by using these commands:
  54.  
  55.     cl -Zi -c stakdemo.c
  56.     link stakdemo+njstacks /noe /noi /codeview;
  57.  
  58. The first command compiles stakdemo.c and does not link the resulting
  59. .OBJ file.  The second command links stackdemo with njstacks, and
  60. lets the linker know that we will be redefining entries in the
  61. standard library.
  62.  
  63. If you use NJSTACK often, you may wish to completely replace the
  64. _chkstk routine provided by Microsoft in the run-time library.  To do
  65. this, use a LIB utility to remove the chkstk module supplied by
  66. Microsoft, and add the appropriate njstack version to the library.
  67.  
  68. To change the SLIBCE.LIB library, for example, to use NJSTACK, we
  69. would use the command
  70.  
  71.     lib slibce.lib -chkstk +njstacks
  72.  
  73. The four versions of NJSTACK are named as follows:
  74.  
  75.     NJSTACKS.OBJ    - njstack for the small model
  76.     NJSTACKM.OBJ    - njstack for the medium model
  77.     NJSTACKC.OBJ    - njstack for the compact model
  78.     NJSTACKL.OBJ    - njstack for the large model
  79.  
  80. To use NJSTACK with the huge model, use NJSTACKL.
  81.  
  82. You may run the STACKDEMO.EXE file to 
  83.  
  84.  
  85.  
  86. Registration
  87. ------------
  88.  
  89. You may register your copy of NJSTACK by sending $10 to my address
  90. below.  Previous users of my software may notice the conspicuous
  91. lack of sourcecode.  I have decided not to include the sourcecode for
  92. this program, and all of my future releases, so that the resulting
  93. packaged file will be smaller.  If you would like to receive the
  94. sourcecode, please include an extra dollar with your registration.
  95.  
  96. NJSTACK includes no known bugs.  This version works with MS-DOS
  97. programs compiled under versions 5.00 and 5.10 of Microsoft C.  I
  98. have not tested it with earlier versions of the compiler, but I
  99. suspect that it will properly function with at least Version 4.00 of
  100. the compiler.
  101.  
  102. The program will not function properly with C programs compiled under
  103. OS/2 or MS/2.  If you need a version of NJSTACK to funciton with
  104. these operating systems, you should contact me with your request.
  105.  
  106.  
  107. You may send your registration and any correspondence or questions to:
  108.  
  109.  
  110. Mike Blaszczak
  111. 112 Verlinden Drive
  112. Monroeville, Pennsylvania
  113.     15146-2041
  114.  
  115.  
  116. Thank you for your registration.
  117.  
  118.  
  119.  
  120.